package com.ydd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydd.dto.YddArticleDto;
import com.ydd.entity.YddArticle;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhangxiaojun
 * @since 2023-05-14
 */
@Mapper
public interface YddArticleMapper extends BaseMapper<YddArticle> {

    /**
     * 文章分类详情
     * @param id
     * @return
     */
//    YddArticleDto getCateById(@Param("id") Long id);
    /**
     * 24小时最新文章数量
     * @param time24
     */
    Integer countBy24Hours(long time24);

    /**
     * 查询顶部文章
     * @param
     * @return
     */
    List<YddArticle> selectByIstop(Integer istop);

    @Select("select *from ydd_article where id=#{articleId}")
    YddArticle selectArticle(Integer articleId);
}
